package com.onesports.intelligent.k12.polarlight.domain.entity.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.onesports.framework.kit.common.valid.Length;
import com.onesports.intelligent.k12.polarlight.common.domain.entity.BaseEntity;
import lombok.*;

import java.io.Serializable;

/**
 * 账号表 sys_account
 *
 * @author wusy
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_account")
@AllArgsConstructor
@NoArgsConstructor
public class Account extends BaseEntity implements Serializable {

    /**
     * 手机号
     * //TODO 手机号限定为数值，同时支持用户名登录
     */
    @TableField("phone")
    private String phone;

    /**
     * 用户名
     */
    @TableField("username")
    @Length(max = 20,message = "用户名不可超过20位")
    private String username;

    /**
     * 性别
     */
    @TableField("gender")
    private String gender;

    /**
     * 密码
     */
    @TableField("password")
    private String password;

    /**
     * 账号状态 true 启用  false禁用
     */
    @TableField("status")
    private Boolean status;


    /**
     * 头像
     */
    @TableField("avatar")
    private String avatar;

    /**
     * 所属单位;学校和运营类型账号没有单位
     */
    @TableField("organization_id")
    private String organizationId;

    @TableField("passwd_updated")
    private Boolean passwdUpdated;

    @TableField(exist = false)
    private String roleName;
    /**
     * 机构状态
     */
    @TableField(exist = false)
    private Boolean organizationStatus;
    /**
     * 是否负责人
     */
    @TableField(exist = false)
    private Boolean isPrincipal;
    /**
     * 是否超管
     */
    @TableField(exist = false)
    private Boolean isSuper;
    /**
     * 员工id
     */
    @TableField(exist = false)
    private String staffId;

    private static final long serialVersionUID = 1L;
}